import React, { useState } from 'react'

const Child = React.memo((props) => {

    console.log('Child 组件被执行了');

    return (<>
        <h1>Child --{props.info.name} -{props.info.age} </h1>
    </>)
})

export default function App() {
    const [count, setCount] = useState(100)

    const [name] = useState('小王')
    const [age] = useState(15)

    const info = {
        name, age
    }

    return (
        <div>
            <h1>App - {count}</h1>

            <button onClick={() => {
                setCount(count + 1)
            }}>点击增加</button>
            <hr />

            <Child info={info} />
        </div>
    )
}
